package vip.specimen.system.datasource.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import java.util.Date;

/**
 * *@Author: 余浪人
 * *@Date：2021/03/07 13:51
 * *@Email:yulangren520@Gmail.com
 * *@QQ:1368419640
 **/
@Setter
@Getter
@Entity
@Table(name = "ad")
@ApiModel(description = "广告数据源模型")
public class SystemAdvertisingEntity extends BaseEntity {
    @Column(length = 128)
    @ApiModelProperty(value = "广告名称", dataType = "String")
    private String advertisingName;
    @OneToOne
    @ApiModelProperty(value = "创建者", dataType = "SystemUserEntity")
    private SystemUserEntity creator;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "到期时间", dataType = "Date")
    private Date endTime;
    @Column(length = 2147483647)
    @ApiModelProperty(value = "广告内容", dataType = "String")
    private String advertisingContent;
    @Column(length = 32, unique = true)
    @ApiModelProperty(value = "广告调用", dataType = "String")
    private String advertisingCallParam;
    @ApiModelProperty(value = "状态", dataType = "boolean")
    private boolean enable = Boolean.FALSE;

    public SystemAdvertisingEntity() {
    }

    public SystemAdvertisingEntity(String advertisingName, SystemUserEntity creator, boolean enable, Date endTime, String advertisingContent, String advertisingCallParam) {
        this.advertisingName = advertisingName;
        this.creator = creator;
        this.enable = enable;
        this.endTime = endTime;
        this.advertisingContent = advertisingContent;
        this.advertisingCallParam = advertisingCallParam;
    }


}
